function Calculate(coefficients,x)
	result = 0
	for i=1,#coefficients do
		result = coefficients[i]*x^(i-1) + result
	end
	return result
end

test = {1,2,3,4}
print(Calculate(test, 2))